package exampleQuestions;

import java.util.Arrays;

public class Question {

	static <T> void mix(T[] s) {
		
		int last = s.length - 1;
		int middle = s.length / 2 - 1;
		while (last > 1) {
			T t = s[last - 1];
			s[last - 1] = s[middle];
			for (int i = middle; i < last - 2; i++) {
				s[i] = s[i + 1];
			}
			s[last - 2] = t;

			last -= 2;
			middle--;
		}
	}

	public static void main(String[] args) {
		String[] s = new String[] { "A", "B", "C", "D", "1", "2", "3", "4" };
		String[] array = new String[] { "a1", "a2", "a3", "b1", "b2", "b3" };
		mix(s);
		System.out.println(Arrays.toString(s));
	}

}
